Skip to content

Reuse EUci instance in inventory loops to reduce initialization overhead#1516

Merged
gsanchietti merged 4 commits intomy_migrationfrom
copilot/sub-pr-1509
Feb 11, 2026
Merged

Reuse EUci instance in inventory loops to reduce initialization overhead#1516
gsanchietti merged 4 commits intomy_migrationfrom
copilot/sub-pr-1509

Conversation

Copy link

Copilot AI commented Feb 11, 2026

Addresses feedback from #1509 to eliminate redundant UCI initialization by reusing the existing EUci() instance instead of creating new ones in each loop iteration.

Changes

  • phonehome script: Modified both fact_* and info_* loops to reuse the u instance created at line 61

Before/After

# Before: Creates new EUci() on every iteration
u = EUci()
# ... use u for UUID operations ...

for func in dir(inventory):
    if func.startswith("info_"):
        method = getattr(inventory, func)
        info[func.removeprefix('info_')] = method(EUci())  # ❌ New instance

# After: Reuses existing instance
for func in dir(inventory):
    if func.startswith("info_"):
        method = getattr(inventory, func)
        info[func.removeprefix('info_')] = method(u)  # ✅ Reuse instance

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 11, 2026 10:30
Co-authored-by: gsanchietti <804596+gsanchietti@users.noreply.github.com>
Co-authored-by: gsanchietti <804596+gsanchietti@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on sending data to enterprise portal proxy Reuse EUci instance in inventory loops to reduce initialization overhead Feb 11, 2026
Copilot AI requested a review from gsanchietti February 11, 2026 10:31
@gsanchietti
Copy link
Member

@copilot do not change .gitignore

Co-authored-by: gsanchietti <804596+gsanchietti@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 11, 2026

@copilot do not change .gitignore

Reverted the .gitignore changes in commit 45c8085.

@gsanchietti gsanchietti marked this pull request as ready for review February 11, 2026 10:36
@gsanchietti gsanchietti merged commit 04918c0 into my_migration Feb 11, 2026
@gsanchietti gsanchietti deleted the copilot/sub-pr-1509 branch February 11, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants